#include "Complex.h"
Complex::Complex()
{
	(*this).real=1.0;
	(*this).imag=1.0;
}
Complex::Complex(double real,double imag){
	(*this).real=real;
	(*this).imag=imag;
}
Complex Vector::operator+(Complex z){
	double real;
	double imag;
	real=(*this).real+z.getReal();
	imag=(*this).imag+z.getImag();
	Complex s=Complex(real,imag);
	return s;}
Complex Complex::operator-(Complex z){
	double real;
	double imag;
	real=(*this).real-z.getReal();
	imag=(*this).imag-z.getImag();
	Complex sc=Complex(real,imag);
	return sc;
}
Complex Complex::operator*(Complex z){
	double real;
	double imag;
	real=(*this).real*z.getReal()-(*this).imag*z.getImag();
	imag=(*this).real*z.getReal()+(*this).imag*z.getImag();
	Complex in=Complex(real,imag);
	return in;
}
Complex Complex::operator/(Complex z){
	double real;
	double imag;
	if((z.getReal()==0)&&(z.getImag()==0))
		{
		real,imag;
		}
	else
	{
	real=((*this).real*z.getReal()+(*this).imag*z.getImag())/(z.getReal()*z.getReal()+z.getImag()*z.getImag());
	imag=((*this).imag*z.getReal()-(*this).real*z.getImag())/(z.getReal()*z.getReal()+z.getImag()*z.getImag());
	Complex im=Complex(real,imag);
	return im;
	}
}
double Complex::getReal(){
	double real;
	real=(*this).real;
	return real;
}
double Complex::getImag(){
	double imag;
	imag=(*this).imag;
	return imag;
}
void Complex::setReal(double real){
	(*this).real=real;
}
void Complex::setImag(double imag){
	(*this).imag=imag;
}



Complex::~Complex() {}


